package com.ss.android.mine;

import android.content.Context;
import android.content.Intent;
import android.support.v4.app.FragmentTransaction;

import com.ss.android.article.base.app.AppData;
import com.ss.android.article.browser.R;
import com.ss.android.common.util.ImmersedStatusBarHelper.ImmersedStatusBarConfig;
import com.ss.android.common.util.ToolUtils;
import com.ss.android.newmedia.activity.FragmentActivity;

public class MineActivity extends FragmentActivity {
    private ae a;

    public MineActivity() {

        this.a = null;
    }

    static void a(MineActivity arg0) {
        arg0.onBackBtnClick();
    }

    public int getDayBackgroundRes() {
        return R.color.activity_bg_color;
    }

    public ImmersedStatusBarConfig getImmersedStatusBarConfig() {
        ImmersedStatusBarConfig v0 = new ImmersedStatusBarConfig();
        v0.mFitsSystemWindows = false;
        v0.c = true;
        v0.setStatusBarColor(com.ss.android.article.browser.R.color.status_bar_color_detail);
        return v0;
    }

    public int getLayout() {
        return R.layout.fo;
    }

    public int getNightBackgroundRes() {
        return R.color.cu;
    }

    public void init() {
        int v2 = 8;
        super.init();
        this.mRootView.setBackgroundResource(this.getDayBackgroundRes());
        this.mTitleBar.setBackgroundResource(com.ss.android.article.browser.R.drawable.h3);
        if (this.mNightModeOverlay != null) {
            this.mNightModeOverlay.setVisibility(v2);
        }

        if (this.mRightProgress != null) {
            this.mRightProgress.setVisibility(v2);
        }

        AppData.getInstance();
        FragmentTransaction v0 = this.getSupportFragmentManager().beginTransaction();
        if (this.a == null) {
            this.a = new ae();
            v0.replace(com.ss.android.article.browser.R.id.a2m, this.a);
        }

        v0.show(this.a);
        v0.commit();
        this.mBackBtn.setOnClickListener(new ac(this));
    }

    public void onBackPressed() {
        if (!this.isFinishing()) {
            Intent v0 = null;
            if (this.isTaskRoot()) {
                v0 = ToolUtils.getLaunchIntentForPackage(((Context) this), this.getPackageName());
            }

            this.finish();
            if (v0 == null) {
                return;
            }

            this.startActivity(v0);
        }
    }
}

